package com.ssl.basics.thread.sync;

import lombok.extern.slf4j.Slf4j;

/**
 * 描述：
 *
 * @author shi_senlin
 * @create 2021/07/06 22:20
 */
@Slf4j(topic = "com.ssl.thread")
public class Ticket {
    private int count = 30;

    public synchronized void sale() {
        if (count > 0) {
            log.info("卖之前 {} 张， 剩余 {} 张", count--, count);
        }
    }

}
